﻿using System;
using System.Collections.Generic;
using System.IO;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Zeus.Classes.Documents;

namespace Zeus.Classes.Engines.Video_Engine
{
    public partial class EditorVideo : UserControl
    {
        public EditorVideo()
        {
            InitializeComponent();
        
        }
        public EditorVideo(Document videoDoc)
        {
            InitializeComponent();
            IsolatedStorageFile isolated = IsolatedStorageFile.GetUserStoreForApplication();
            IsolatedStorageFileStream isolatedStorageFileStream = isolated.OpenFile(videoDoc.FilePath, FileMode.Open,FileAccess.Read);
            media.SetSource(isolatedStorageFileStream);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
           
            media.Stop();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            media.Pause();

           
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            media.Play();
        }

        private void Mute_Click(object sender, RoutedEventArgs e)
        {
            media.Volume = 0;
            slider_1.Value = 0;
        }

        private void Slider1ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {

            media.Volume = slider_1.Value;
 
        }
   
    }
}
